import java.io.*;
import java.net.*;

import sun.misc.IOUtils;

public class Connect {
	/*
	 * Р§С‚Рѕ-С‚Рѕ РЅР°РїРёС€РµРј
	 * Р� РµС‰Рµ С‡С‚Рѕ-С‚Рѕ
* */

	String html="";
	boolean connection;
	URLConnection UrlConnection;
	public Connect (String address) {
			URL Url;
			try {
				Url = new URL(address);
				UrlConnection= Url.openConnection();
				UrlConnection.addRequestProperty("User-Agent", "Mozilla/5.0");
				BufferedReader bufRdr = new BufferedReader(new InputStreamReader(UrlConnection.getInputStream(), "UTF-8"));
				String line;
				while ((line = bufRdr.readLine())!=null) html+=line;
				connection = true;
			} catch (MalformedURLException e) {
				// TODO Auto-generated catch block
				System.out.println("wrong address");
				System.out.println("Trying to read from buffer");
				//e.printStackTrace();
			} catch (IOException e){
				System.out.println("Connection failed!!");
				System.out.println("Trying to read from buffer");
				//e.printStackTrace();
			} catch (Exception e){
				System.out.println("Trying to read from buffer");
			}
			
		}
	String getRawHtml() {
		return html;
	}
	
	
}
